Skip to content

feat: parallel execution framework#1428

Merged
TimothyZhang7 merged 4 commits intoaden-hive:mainfrom
TimothyZhang7:feature/parallel-fanout
Jan 27, 2026
Merged

feat: parallel execution framework#1428
TimothyZhang7 merged 4 commits intoaden-hive:mainfrom
TimothyZhang7:feature/parallel-fanout

Conversation

@TimothyZhang7
Copy link
Collaborator

@TimothyZhang7 TimothyZhang7 commented Jan 27, 2026

Description

Implements #157

Summary

  • Adds a parallel execution (fan-out / fan-in) framework to GraphExecutor, enabling a single node to execute multiple downstream branches concurrently via asyncio.gather()
  • Introduces ParallelBranch and ParallelExecutionConfig dataclasses for controlling branch lifecycle, timeouts, and failure strategies (fail_all, continue_others, wait_all)
  • Adds detect_fan_out_nodes() and detect_fan_in_nodes() to GraphSpec for static analysis of parallel topology in edge definitions
  • Implements automatic convergence detection (_find_convergence_node()) so branches rejoin at a shared downstream node
  • Supports per-branch retry via node max_retries, configurable memory conflict resolution (last_wins, first_wins, error), and a 300s default branch timeout

Changed files

  • core/framework/graph/executor.py — parallel branch execution, convergence detection, multi-edge traversal
  • core/framework/graph/edge.py — fan-out/fan-in detection on GraphSpec
  • core/framework/graph/node.py — async memory write support for parallel context
  • core/framework/llm/litellm.py — minor adjustment for parallel compatibility
  • core/framework/runtime/execution_stream.py — stream support addition

Test plan

  • Verify fan-out triggers when a node has multiple ON_SUCCESS edges
  • Verify all branches execute concurrently (not sequentially)
  • Verify convergence: all branches rejoin at the correct fan-in node
  • Test fail_all strategy cancels remaining branches on first failure
  • Test continue_others strategy lets healthy branches complete
  • Test wait_all strategy collects all results before proceeding
  • Test branch timeout fires at configured branch_timeout_seconds
  • Test memory conflict strategies (last_wins, first_wins, error)
  • Test per-branch retry respects node max_retries
  • Verify single-edge paths still execute normally (no parallel overhead)

@TimothyZhang7 TimothyZhang7 merged commit 9c28284 into aden-hive:main Jan 27, 2026
13 of 14 checks passed
jhalak999 pushed a commit to jhalak999/hive that referenced this pull request Feb 17, 2026
…-fanout

feat: parallel execution framework
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant